import java.util.Scanner;

public class test {

    //5
    public static void wei(int n){
        if(n<10) {
            System.out.println(n);
        }else{
            wei(n/10);
            System.out.println(n%10);
        }

    }

    public static void main(String[] args) {
        wei(123);
    }

    //4
    public static int sum(int n){
        if(n==1)
            return 1;
        return n+sum(n-1);
    }

    public static void main4(String[] args) {
        System.out.println(sum(10));
    }

    //3
    public static int jc(int n){
        if(n==1){
            return 1;
        }
        return n*jc(n-1);
    }

    public static void main3(String[] args) {
        System.out.println(jc(5));
    }

    //2
    public static int max(int a,int b){
        int ret=a>b?a:b;
        return ret;
    }

    public static double max(double a,double b,double c){
        double ret1=a>b?a:b;
        double ret2=a>c?a:c;
        double max=ret1>ret2?ret1:ret2;
        return max;
    }

    public static void main2(String[] args) {
        Scanner scan=new Scanner(System.in);
        int a= scan.nextInt();
        int b= scan.nextInt();
        double a1= scan.nextDouble();
        double b1= scan.nextDouble();
        double c1= scan.nextDouble();
        System.out.println(max(a,b));
        System.out.println(max(a1,b1,c1));
    }

    //1
    public static int add(int a,int b){
        return a+b;
    }

    public static double add(double a,double b,double c){
        return a+b+c;
    }

    public static void main1(String[] args) {
        System.out.println(add(1,2));
        System.out.println(add(1.0,2.0,3.0));
    }
}
